#pragma once

#include <QMainWindow>
#include <QPushButton>
#include <QLineEdit>
#include <QGroupBox>
#include <QStackedWidget>

class RenderWidget;
class Controller;

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow() override;
    void switchToFunctionSelect();

private slots:
    void onAddClicked();
    void onTransformClicked();

private:
    // 渲染区与逻辑控制器
    RenderWidget *renderWidget;
    Controller   *controller;

    // 控制面板控件
    QGroupBox   *controlGroup_;
    QLineEdit   *leX1_, *leY1_, *leX2_, *leY2_;
    QLineEdit   *leA11_, *leA12_, *leA21_, *leA22_;
    QPushButton *btnAdd_, *btnTransform_;

    // UI 构建与信号连接
    void setupUi();
    void setupConnections();

    QStackedWidget *stackedWidget_;
};
